﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using WpfExceptionWindow;
using System.Threading;

namespace WpfExceptionWindowTest
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>
    public partial class Main : Window
    {
        public Main()
        {
            InitializeComponent();

            //MessageBox.Show("testing",
            //    "Top",
            //    MessageBoxButton.OK,
            //    MessageBoxImage.Asterisk,
            //    MessageBoxResult.OK,
            //    MessageBoxOptions.RtlReading);

            Thread t = new Thread(new ThreadStart(t_Start));
            t.Start();
        }

        public void t_Start()
        {
            var stff = new List<int>();

            try
            {
                stff[0] = 100;
            }
            catch (Exception e)
            {
                var ex = new Exception("Testing", e);
                var ex1 = new Exception("Testing", ex);
                var res = ExceptionWindow.Show(ex1,
                    "Caption",
                    ExceptionWindowButton.AbortContinueRetry,
                    ExceptionWindowImage.Error,
                    ExceptionWindowResult.Continue,
                    ExceptionWindowOptions.None);
                Console.WriteLine(res.ToString());
            }
        }
    }
}
